package dao;

import entity.User;
import entity.car;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

//
public class UserDB {
    //    唯一数据源
   private static final List<User> userlist=new CopyOnWriteArrayList();

    private  UserDB(){

    }
    //    初始化数据源
    static {
        List<car> list1=new CopyOnWriteArrayList();
        List<car> list2=new CopyOnWriteArrayList();
        userlist.add(new User(0,"xxxxxxx","123456","100006@qq.com","12345678901","2021.12.27",list2));
            userlist.add(new User(1,"manager","123456","100006@qq.com","12345678901","2021.12.27",list1 ));
        userlist.add(new User(0,"test","123456","100006@qq.com","12345678901","2021.12.27",list2));
    }
    //    返回数据主体
    public  static  List<User> getInstance(){
        return userlist;
    }

}

